package com.yjd.pub.doctor.service;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.doctor.model.DoctorProjectModel;
import com.yjd.comm.doctor.service.IDoctorProjectService;
import com.yjd.pub.doctor.dao.IDoctorProjectDao;

/**
 * <b>description</b>：医生项目关联业务实现<br>
 * <b>time</b>：2017-06-27 08:52:31 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
@Service("doctorProjectService")
public class DoctorProjectServiceImpl extends BaseServiceImpl implements IDoctorProjectService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public DoctorProjectModel insert(DoctorProjectModel model) throws Exception {
		return this.doctorProjectDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(DoctorProjectModel model) throws Exception {
		return this.doctorProjectDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.doctorProjectDao.deleteModel(paramMap, true);
	}

	@Resource
	private IDoctorProjectDao doctorProjectDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.doctorProjectDao;
	}

}
